package com.example.boot3.rpc.controller;

import com.example.boot3.rpc.Service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
public class TianqiController {
    @Autowired
    WeatherService weatherService;

    @GetMapping("/getWeather")
    public Mono<String> getWeather(@RequestParam("area") String area) {
        Mono<String> weather = weatherService.getWeather(area);
        return weather;
    }
}
